package com.fuqi.framework.utils;

public class StringUtils {
    public static final String EMPTY = "";
    public static final String SPACE = " ";

    public static int charLength(String paramString) {
        if (isEmpty(paramString)) {
            return 0;
        }
        char[] arrayOfChar = paramString.toCharArray();
        int k = 0;
        for (int i = 0; i < arrayOfChar.length; i++) {
            int m = arrayOfChar[i];
            if (m < 0 || m > 127) {
                k += 2;
                continue;
            }
            k++;
        }
        return k;
    }

    public static String forceEllipsizeEnd(String paramString, int length) {
        if (paramString.length() > length) {
            paramString = paramString.substring(0, length) + "...";
        }
        return paramString;
    }

    public static boolean isBlank(String paramString) {
        if (paramString != null) {
            if (paramString.length() != 0) {
                for (int i = 0; i < paramString.length(); i++) {
                    if (!Character.isWhitespace(paramString.charAt(i))) {
                        return false;
                    }
                }
            }
        }
        return true;
    }

    public static boolean isEmpty(String paramString) {
        if ((paramString == null) || (paramString.length() == 0)) {
            return true;
        }
        return false;
    }

    public static boolean isNotBlank(String paramString) {
        if (!isBlank(paramString))
            return true;
        return false;
    }

    public static boolean isNotEmpty(String paramString) {
        if (!isEmpty(paramString))
            return true;
        return false;
    }
}
